#{extends 'main.html' /}
#{set title:'edit.html' /}

#{navigation /}

<div class="content">
		<h1>Edit your profile, ${user.name}</h1>
	
	#{form @Users.saveChanges()}
		<span>
			Current email: ${user.email}<br>
			<label for="email">New email:</label>
			<input type="text" name="email" id="email" value="${flash.email}" />
			<span class="error">#{error 'email' /}</span>
			<span class="error">${flash.mailError }</span>
		</span><br><br>
		<span>
			Current real name: ${user.realname}<br>
			<label for="realname">New real name:</label>
			<input type="text" name="realname" id="realname" value="${flash.realname}" />
		</span><br><br>
		<span>
			<label for="password">New Password:</label>
			<input type="password" name="password" id="password" value="${flash.password}" />
			<span class="error">#{error 'password' /}</span>
		</span><br>
		<span>
			<label for="passwordRepeat">Repeat password:</label>
			<input type="password" name="passwordRepeat" id="passwordRepeat" value="${flash.passwordRepeat}" />
			<span class="error">#{error 'passwordRepeat' /}</span>
		</span><br>
		<span>
			<input type="submit" id="register" value="Save Changes" />
		</span>
	#{/form}
</div>